<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" type="text/css" href="<%=path %>/static/css/css.css?1" />
<link rel="stylesheet" type="text/css" href="<%=path %>/static/jquery-ui/jquery-ui.min.css" />
<script type="text/javascript" src="<%=path %>/static/js/json2.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/jquery.js"></script>
<script type="text/javascript" src="<%=path %>/static/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="<%=path %>/static/layer/layer.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/gridview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/formview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/tool.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/validate.js"></script>
<SCRIPT type="text/javascript">
    var data = [];
    var userId='${param.id}';
    var descs='${param.descs}';
    if(userId!=""){
       data.push({r:"=",name:'userId',value:userId});
    }
    data.push({r:"=",name:'descs',value:descs});
    <!--
    var formSetting0 = {
    		po:'UserLog',
    		type:"query",
    		hiddens:["id"],
    	fields:[[{title:"名称",type:"text",name:"userName"}
    	  ]
    	],
    	queryRow:{align:'center',buttons:[
		                 			   {
		                 			    	 id:'query',
		                 			    	 title:'查询',
		                 			    	 handlers:{
		                 			    		 click: function(e,queryForm){
		                 			    			 queryData(e,queryForm);
		                 			    		 }
		                 			    	 }
		                 			     }, {
		                 			    	 id:'resetbtn',
		                 			    	 title:'重置',
		                 			    	 handlers:{
		                 			    		 click: function(){
		                 			    			 form0.reset();
		                 			    		 }
		                 			    	 }
		                 			     }
		                 			 ]}
    }

    function queryData(e,queryForm){
    	var userName = queryForm.find(":input[name=userName]").val();

    	if(userName!==""){
    		data.push({r:"like",name:'userName',value:"%"+userName+"%"});
    	}

    	grid.load({data:data});
    	ajustHeight();
    }
	var gridSetting = {
			id:'UserLogGrid',
			po:"UserLog",
			title:'登陆日志',
			height:'auto',
			service:"uiServices!listSimple",
			pageInfo: {
				records: 12,//auto表示根据容器高度自动判断
				orderby : "createDateTime desc"
			},

			fields:[
			   {
				   name: 'ip',
				   descs:"IP",
				   align:'center',
				   width:200
			   },{
				   name: 'userName',
				   descs:"名称",
				   align:'center',
				   width:200
			   }
			   ,{
               	   name: 'createDateTime',
               	   descs:"登陆时间",
               	   align:'center',
               	   width:200
               }
			]
		};
	var grid,form0;
    $(document).ready(function(){
    	form0 = new FormView("formview0",formSetting0);
    	form0.init();
    	grid = new GridView("list",gridSetting,"list");
		grid.init();

		grid.load({data:data});

		ajustHeight();
    });
    //-->
</SCRIPT>
</head>

<body>
<div id="formview0" class="rbox1"></div>
<div id="formview" class="rbox1"></div>
<div id="list" class="rbox2"></div>
<script type="text/javascript" src="<%=path %>/static/js/underscore.js"></script>
<script type='text/javascript' src='<%=path %>/static/My97DatePicker/WdatePicker.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/interface/BaseDwr.js'></script>
</body>
</html>